﻿using System;
using Ayatta.Contract.Domain;
using Ayatta.Contract.Component;
using System.Collections.Specialized;

namespace Web.Base.OnlinePays
{
    public interface IOnlinePay
    {
        /// <summary>
        /// 接收到第三方平台通知并验证通过后触发
        /// </summary>
        Func<Notification, bool> Notityed { get; set; }

        /// <summary>
        /// 生成支付请求Url
        /// </summary>
        /// <returns></returns>
        string GetPayUrl(PayTrade trade);

        /// <summary>
        /// 处理支付平台通知
        /// </summary>
        /// <param name="nv">第三方支付平台通知参数</param>
        /// <returns></returns>
        SkResult<Notification> NotityHandler(NameValueCollection nv);
    }
}